<template>
  <div id="app">
    <el-container>
      <el-header class="header">
        <!-- <el-dropdown> -->
        <el-menu
            :default-active="activeIndex"
            class="el-menu-demo"
            mode="horizontal"
            @select="handleSelect"

        >
          <div id="logo">
            <el-image
                :src="require('@/assets/WebstormLogo.png')"
                alt="sorry"
                @error="imageError"
                onClick="logoFunction"
            />
          </div>
          <el-menu-item index="1"
          >
            <el-link :underline="false" href="/App">首页</el-link>
          </el-menu-item
          >
          <el-submenu index="2">
            <template slot="title">视频</template>
            <el-menu-item index="2-1">数码测评</el-menu-item>
            <el-menu-item index="2-2">Vlog</el-menu-item>
            <el-menu-item index="2-3">Mac技巧</el-menu-item>
            <el-submenu index="2-4">
              <template slot="title">教程</template>
              <el-menu-item index="2-4-1">前端</el-menu-item>
              <el-menu-item index="2-4-2">Java</el-menu-item>
              <el-menu-item index="2-4-3">python</el-menu-item>
            </el-submenu>
          </el-submenu>
          <el-menu-item index="3">
            <el-link :underline="false" href="https://gitee.com/webstorm_dxy"
            >代码仓库
            </el-link
            >
          </el-menu-item>
          <el-menu-item index="4">
            <!-- <router-link to="/About">关于</router-link> -->
            <el-link :underline="false" href="/about">关于</el-link>
          </el-menu-item>
        </el-menu>
        <!-- </el-dropdown> -->
      </el-header>
    </el-container>
    <!-- <el-main class="main-index"> -->
    <el-card id="hello">
      <img src="./assets/hello.gif" width="1000" height="450"/>
    </el-card>
    <div class="one">
      <!--      这里是站位的div-->
    </div>
    <!-- I want to make a button -->
    <!-- <router-view></router-view> -->
    <hr id="line">

    <el-main>
      <el-row>
        <el-col
            :span="8"
            v-for="(o, index) in 1"
            :key="o"
            :offset="index > 0 ? 2 : 0"
        >
          <el-card :body-style="{ padding: '0px' }">
            <!-- <img
            src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
            class="image"
          /> -->
            <!--          TODO: 此处需要修改-->
            <img src="./assets/html.png" class="image">
            <div style="padding: 14px">

              <span>HTML零基础教程</span>
              <div class="bottom clearfix">
                <time class="time">{{ currentDate }}</time>
                <el-button type="text" class="button" @click="jump_html_b('web')">进入</el-button>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
      <el-row>
        <el-col
            :span="8"
            v-for="(o, index) in 1"
            :key="o"
            :offset="index > 0 ? 2 : 0"
        >
          <el-card :body-style="{ padding: '0px' }">
            <!-- <img
            src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png"
            class="image"
          /> -->
            <!--          TODO: 此处需要修改-->
            <img src="./assets/UTM.png" class="image">
            <div style="padding: 14px">

              <span>Mac小技巧</span>
              <div class="bottom clearfix">
                <time class="time">{{ currentDate }}</time>
                <el-button type="text" class="button" @click="jump_html_b('mac')">进入</el-button>
              </div>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </el-main>
    <div class="line"></div>
<!--    -->
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "1",
      activeIndex2: "1",

      url: "@/assets/WebstormLogo.png",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    jump_html_b: function (channel) {
      if (channel === 'web') {
        window.location.href = "https://space.bilibili.com/640677415/channel/detail?cid=195457&ctype=0"
      } else if (channel === 'mac') {
        window.location.href = "https://space.bilibili.com/640677415/channel/detail?cid=185293&ctype=0"
      }

    },
  },

};

</script>

<style>
/* #app {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */

#logo {
  width: 120px;
  height: 70px;
  /* display: inline; */
  float: left;
}

#hello {
  width: 1050px;
  height: 550px;
  margin-left: 180px;
  margin-top: 60px;
  border-radius: 20px;
}

#line {
  color: #888888FF;
}

.el-menu-demo {
  overflow-x: auto;
}

.main-index {
  margin-left: 0px;
}

.time {
  font-size: 13px;
  color: #999;
}

.bottom {
  margin-top: 13px;
  line-height: 12px;
}

.button {
  padding: 0;
  float: right;
}

.image {
  width: 100%;
  display: block;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}

.clearfix:after {
  clear: both;
}

.header {
  position: relative;
}

.one {
  height: 200px;
}
</style>
